package com.csmall.business.controller;

import com.csmall.business.service.BusinessService;
import com.csmall.commons.restful.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Name: BusinessController
 * @Author: 西风残叶
 * @Date: 2024/8/18 16:04
 * @Version: 1.0
 * @TODO: TODO
 */
@RestController
@Slf4j
@RequestMapping("/base/business")
@Api(tags = "业务触发服务")
public class BusinessController {
    @Autowired
    private BusinessService businessService;
    public BusinessController(){
        log.info("创建了BusinessController控制器");
    }
    @PostMapping("/buy")
    @ApiOperation("执行购买业务的触发")
    public JsonResult buy() {
        businessService.buy();
        return JsonResult.ok("已经触发购买业务");
    }
}